<?php
/**
* @version		$Id: view.html.php 5 2011-10-29 10:13:13Z netix.mail@gmail.com $
* @package		ALM Hotel Menager	
* @subpackage	com_almhm
* @author		ALM Studio
* @copyright	Copyright 2011 ALM Studio. All rights reserved
* @licence		Commercial
*/

defined('_JEXEC') or die('Restricted access');

jimport('joomla.application.component.view');

class AlmHmViewPonudas extends JView
{
	protected $items;
	protected $pagination;
	protected $state;
	protected $form;
		
	function display($tpl = null) 
	{
		$this->items 		= $this->get('Items');
		$this->pagination 	= $this->get('Pagination');
		$this->state		= $this->get('State');
		$this->mjesto		= $this->get('Mjesto');
		$this->kategorija	= $this->get('kategorija');

		if (count($errors = $this->get('Errors'))) 
		{
			JError::raiseError(500, implode('<br />', $errors));
			return false;
		}

		$this->addToolBar();

		parent::display($tpl);

		$this->setDocument();
	}

	protected function addToolBar() 
	{
		JToolBarHelper::title(JText::_('COM_ALMHM_PONUDE'), 'ponudas');
		JToolBarHelper::deleteListX('', 'ponudas.delete', 'COM_ALMHM_LIST_OBRISI');
		JToolBarHelper::editListX('ponuda.edit', 'COM_ALMHM_LIST_IZMJENI');
		JToolBarHelper::addNewX('ponuda.add', 'COM_ALMHM_LIST_DODAJ');
	}

	protected function setDocument() 
	{
		$document = JFactory::getDocument();
		$document->setTitle(JText::_('COM_ALMHM_PONUDE_SITE_TITLE'));
	}
}